package com.zc.controller;

import com.zc.entity.Item;
import com.zc.entity.Userteam;
import com.zc.mapper.ItemMapper;
import com.zc.mapper.UserteamMapper;
import org.omg.CORBA.PUBLIC_MEMBER;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@Controller
public class AdminItemConller {
    Logger logger = LoggerFactory.getLogger(getClass());
    @Autowired
    ItemMapper itemMapper;
    @Autowired
    UserteamMapper userteamMapper;
    @ResponseBody
    @GetMapping ("/adminitemlist")
    public List getAllTeam()
    {
        List map=itemMapper.selectAll2();
        logger.info(map.toString());
        return map;
    }
    @ResponseBody
    @DeleteMapping("/adminitem/{id}")
    public  void deleteadminItem(@PathVariable("id") int id)
    {
        userteamMapper.deleteByPrimaryKey(id);
    }
    @ResponseBody
    @GetMapping ("/adminteamlist")
    public List getAllItem()
    {
        List map=itemMapper.selectAll3();
        logger.info(map.toString());
        return map;
    }
}
